#include <stdio.h>

void Convert(int x, char* str)
{
	int arr[32] = { 0 };
	int i = 31;
	while (x)
	{
		arr[i] = x % 2;
		x /= 2;
		i--;
	}
	int temp = 0;
	i = 31;
	int m = 0;
	while (i >= 3)
	{
		temp = arr[i] * 1 + arr[i - 1] * 2 + arr[i - 2] * 4 + arr[i - 3] * 8;
		if (temp >= 0 && temp < 10)
			*(str+m) = temp + '0';
		else
			*(str+m) = temp - 10 + 'A';
		m++;
		i -= 4;
	}
}

int main()
{
	int x = 0;
	scanf("%d", &x);
	char str[8] = { 0 };
	Convert(x, str);
	int i = 7;
	while (str[i] == '0')
	{
		i--;
	}
	while (i >= 0)
	{
		printf("%c", str[i]);
		i--;
	}
	return 0;
}

